<!-- layout::.:public_header::0 -->
<!--taglib name="html" /-->
<!--<?php
	$typenames = array(
		'digu' => '嘀咕',
		'twitter' => '推特',
	);
	$actions = array(
		'r' => '自动读取并写入自动更新的服务',
		'w' => '自动更新',
		'u' => '手动更新(在本站更新的状态会同步写入)',
	);
?>-->

<div>
	<div id="grid_profile"></div>
	<script>
		$.gx.makeGrid('#grid_profile', '{:U("mblog-profile/json")}',
		[
			{field:'mblog_profile_id', type:'id'},
			{field:'type', name:'类型', type:'select', options:['嘀咕','推特'], values:['digu','twitter']},
			{field:'mblog_user', name:'用户名', type:'text', css:{width:80}},
			{field:'action', name:'动作', type:'select', options:['自动读取并写入自动更新的服务','自动更新','手动更新(在本站更新的状态会同步写入)'], values:['r','w','u']},
			{field:'pass', name:'密码', type:'password', css:{width:80}}
		]);
	</script>

	<table>
		<tr>
			<td>服务类型</td>
			<td>用户名</td>
			<td>动作</td>
			<td>密码(动作为读取时不用填写)</td>
			<td>操作</td>
		</tr>
		<!--volist name="LIST" id="vo"-->
		<tr>
			<td>
			<form action="{:U('mblog-profile/edit')}" method="post">
			<input type="hidden" name="mblog_profile_id" value="{$vo.mblog_profile_id}" />
				<!--html:select options="typenames" name="type" selected="vo['type']" /--></td>
			<td><input type="text" name="mblog_user" value="{$vo.mblog_user}" /></td>
			<td><!--html:select options="actions" name="action" selected="vo['action']" /--></td>
			<td><input type="password" name="pass" /></td>
			<td>
				<input type="submit" value="{%edit}" name="submit" />
				<input type="submit" value="{%delete}" onclick="$.post('{:U('mblog-profile/del?ajax=yes')}', 'mblog_profile_id={$vo.mblog_profile_id}&{:C('TOKEN_NAME')}={~$t=C('TOKEN_TYPE');echo $t(microtime(true));}', $.gx.parseResult, 'JSON');return false;" /></form>			
			</td>
		</tr>
		<!--/volist-->
		<tr>
			<td colspan="5">添加服务</td>
		</tr>
		<tr>
			<td><form action="{:U('mblog-profile/add')}" method="post">
				<!--html:select options="typenames" name="type" /-->
			</td>
			<td><input type="text" name="mblog_user" /></td>
			<td>
				<!--html:select options="actions" name="action" /-->
			</td>
			<td><input type="password" name="pass" /></td>
			<td><input type="submit" value="{%add}" /></form></td>
		</tr>
	</table>
	
	<script type="text/javascript">
		$.gx.ajaxForm('form');
	</script>
	
</div>
<!-- layout::.:public_footer::0 -->